package com.zb.mobile.network.controller;

import com.zb.entity.AccounLoginInfo;
import com.zb.entity.SelectVo;
import com.zb.mobile.network.service.ConNetworkStoreMobileService;
import com.zb.result.Result;
import com.zb.utils.TokenNetworkUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author WEN
 * @Date 2024/3/12 0012
 **/
@Api(tags = "服务商移动端仓库类接口")
@RestController
@RequestMapping("/mobile/network/store")
public class NetworkStoreMobileController {
    @Resource
    private ConNetworkStoreMobileService conNetworkStoreMobileService;

    @ApiOperation("获取服务商个人仓列表")
    @PostMapping("/getStoreList")
    public Result getNetworkMobileStoreList(HttpServletRequest request, @RequestBody @ApiParam(value = "关键词搜索：仓库名称") SelectVo selectVo) {
        AccounLoginInfo loginInfo = TokenNetworkUtil.getAccountLoginInfo(request);
        return Result.success("获取服务商个人仓列表成功").data(conNetworkStoreMobileService.getNetworkMobileStoreList(loginInfo, selectVo));
    }

    @ApiOperation("获取服务商仓库商品明细列表")
    @PostMapping("/getStoreGoodsList/{storeId}")
    public Result getNetworkMobileStoreGoods(@PathVariable @ApiParam(value = "仓库ID") Long storeId, @RequestBody @ApiParam(value = "关键词搜索：仓库名称") SelectVo selectVo) {
        return Result.success().data(conNetworkStoreMobileService.getNetworkMobileStoreGoods(storeId, selectVo));
    }
}
